/*
============================================================================
 Name        : BlockBKLX.h
 Author      : \xD5\x{017c}\xD2\xE7\xE2
 Version     :
 Copyright   : Your copyright notice
 Description : \xB0\xE5\xBF\xE9\xC1\xAA\xCF\xEB\xBD\xE7\xC3\xE6
============================================================================
*/

#ifndef BLOCKBKLX_H
#define BLOCKBKLX_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "BlockGoods.h"

// CLASS DECLARATION

class TItem
{
public:
	TItem(TInt8 aType, TInt16 aId, const TDes& nName, TBool aIsSystem = EFalse) 
	{
		iType = aType;
		iId = aId;
		iName.Copy(nName);
		iIsSystem = aIsSystem;
	}

	enum {BIG, SMALL};
	TInt8 iType;
	TInt16 iId;
	TBuf<8> iName;
	TBool iIsSystem;
};

/**
*  CBlockBKLX
* 
*/
class CBlockBKLX : public CBlockGoods
{
public: // Constructors and destructor
	~CBlockBKLX();
	static CBlockBKLX* NewL(CBaseBlock* bsBack);
	static CBlockBKLX* NewLC(CBaseBlock* bsBack);

private:
	CBlockBKLX(CBaseBlock* bsBack);
	void ConstructL();

public:
	void OnDraw(CFbsBitGc& g) const;
	void OnKeyDown(TInt keyCode);
	void OnMouseUp(const TPoint& aPt);
	void ChangeScrollPos(TInt nPos);
	void SizeChanged();

	TInt GetDataLength();
	TInt16 GetDataType();
	TBool ReadData(const TDesC8& aData);
	void WriteData(TDes8& aBuf);

private:
	enum {MarginSpace = 10};
	TInt m_nCurrent;
	RArray<TItem> iItemArray;
	RArray<TItem> iShowArray;
};

#endif // BLOCKBKLX_H
